import thunkMiddleware from 'redux-thunk';
import { createLogger } from 'redux-logger';
import { createStore, applyMiddleware,combineReducers } from 'redux';

import navReducer from '../app/app.reducer'; //导航
import countTime from '../components/CountDown/count.time.reducer'; //倒计时
import Theme from '../components/Theme/theme.reducer'; //皮肤
import showHistory from '../components/ShowHistory/show.history.reducer'; //历史记录
import netInfo from '../components/NetInfo/net.info.reducer'; //网络

let middleware = [thunkMiddleware];
if(__DEV__){
    let loggerMiddleware = createLogger();
   // middleware=[...middleware,loggerMiddleware];
   middleware=[...middleware];
}else {
    middleware=[...middleware];
}
const todoStore = combineReducers({
    navReducer,
    countTime,
    Theme,
    showHistory,
    netInfo
});
export const store = createStore(
    todoStore,
    applyMiddleware(...middleware)
);